<template>
  <div>
    <router-view />

    <van-tabbar
      v-if="!router.currentRoute.value.meta.isHide"
      v-model="active"
      route
    >
      <van-tabbar-item to="/home" icon="home-o">主页</van-tabbar-item>
      <van-tabbar-item to="/type" icon="search">分类</van-tabbar-item>
      <van-tabbar-item to="/cart" icon="friends-o">购物车</van-tabbar-item>
      <van-tabbar-item to="/my" icon="setting-o">个人中心</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
// 引入路由
import { useRouter } from "vue-router";
// 引入ref
import { ref, onMounted } from "vue";
export default {
  setup() {
    let active = ref(0);
    let router = useRouter();

    return { active, router };
  },
};
</script>

<style lang="less">
</style>
